#pragma once

#include <iostream>
#include <string>
#include <time.h>

using namespace std;

string GetCurrTime()
{
    time_t t = time(nullptr);
    struct tm* curr = ::localtime(&t);

    char currtime[32];
    // 向指定流输入 年月日时分秒
    snprintf(currtime, sizeof(currtime), "%d-%d-%d %d:%d:%d",
        curr->tm_year + 1900, curr->tm_mon + 1, curr->tm_mday, 
        curr->tm_hour, curr->tm_min, curr->tm_sec);
    return currtime;
}